package cp3120.ucm.client;

import cp3120.net.AirportClient;
import cp3120.ucm.*;
import cp3120.view.MainUI;
import cp3120.view.RegistrationUI;

/**
 * Author: Adam Scarr
 * Date: 26/03/2009
 * Time: 8:51:42 AM
 * PRECONDITION: User has made a request to update thier account details <br>
 * POST-CONDITION: The system has displayed the update UI <br>
 * 1. System displays the registrationUI<br>
 * 2. System populates the registrationUI with the user's current details<br>
 * 3. System creates an event listener for when the user updates thier details<br>
 */
public class UCDisplayUpdateDetails implements UCController {
    public void run() {
        RegistrationUI ui = MainUI.getInstance().getRegistrationUI();
        ui.setVisible(true);
        ui.loadFrom(AirportClient.getInstance().getUser());
        MainUI.getInstance().getRegistrationUI().setRegistrationAction(new UC2ALAdapter(new UCUpdateUser()));
    }
}
